package com.itjiange;

import java.util.Arrays;
import java.util.List;

/**
 * 服务员
 *
 * @author ItJianGe
 * @data 2024/8/26 11:05
 */
public class Witter {

    public void printAllMenus(Menu... menus) {
        List<Menu> menuList = Arrays.stream(menus).toList();
        for (Menu menu : menuList) {
            MenuIterator menuIterator = menu.getMenuIterator();
            while (menuIterator.hasNext()) {
                printMenu(menuIterator.next());
            }
        }
    }

    public void printMenu(MenuItem menuItem) {
        System.out.println(String.format("菜名：%s，描述：%s，价格：%.1f", menuItem.getName(),
                menuItem.getDescribe(), menuItem.getPrice()));
    }
}
